/*
 * @Author: cygao
 * @Date: 2018-11-17 23:08:25
 * @Last Modified by: cygao
 * @Last Modified time: 2018-11-25 22:57:09
 */

import React, { Component } from 'react';
import {Link} from 'react-router-dom';
import './collectionList.less';

export default class Register extends Component {
    constructor() {
        super()
    }
    //挂载前
    componentWillMount(){
      console.log(this.props);
    }
    render() {
        return (
            <div className={this.props.listClass}>
              {this.props.data.map((item, index) => {
                 var url = `/gDetail/${item.item_id}`;
                 var item = item.items;
                 return  <Link to={url}
                          className="list-item list-margin">
                            <img className="item-img" src={item.pict_url} alt=""/>
                            <div className="item-content">
                              <div className="item-title">
                                <img className="title-logo" src={item.pict_url} alt=""/>
                                <div className="title-text">{item.title}</div>
                              </div>
                              <div className="item-middle">
                                <div className="item-coupon">{item.coupon_name}</div>
                                <div className="item-commission">预估佣金：{item.forecast_commission}</div>
                              </div>
                              <div className="item-foot">
                                <div className="foot-text">券后价<span className="foot-price">￥{item.coupon_after_price || (item.zk_final_price - item.coupon_amount).toFixed(2)}</span><span className="pri">¥{item.zk_final_price}</span></div>
                                <div className="foot-volume">已售{item.volume}</div>
                              </div>
                            </div>
                          </Link>
              })}
            </div>
        )
    }
}
